<?php
class AniadirEntrada
{
    function conectarDb() {
    if (!($link = mysql_connect("localhost", "root", "root"))) {
        echo "Error conectando a la base de datos.";
        exit();
    }
    if (!mysql_select_db("comunio", $link)) {
        echo "Error seleccionando la base de datos.";
        exit();
    }
    return $link;
    }

    function addEntry($iden, $conten, $usu) {
    $conn = $this->conectarDb();
    $sql = "INSERT INTO comunio.guestbook (id, content, user) VALUES ($iden, '$conten', '$usu');";
    $result = mysql_query($sql);
    }
}

?>
